#include "gameengine\GameEngine.h"

int GameEngine::initialise()
{
	device = createDevice(EDT_OPENGL, dimension2d<s32>(width, height), colorDepth, false, false, false, 0);
	if (!device){
		std::cerr << "Device could not be created" << std::endl;
		errors = 1;
	}
	device->setWindowCaption(name.c_str());
	
	driver = device->getVideoDriver();
	smgr = device->getSceneManager();
	guienv = device->getGUIEnvironment();
}

int GameEngine::clean()
{
}

GameEngine::GameEngine(std::string name, int width, int height)
{
	GameEngine(name, width, height, 16);
}

GameEngine::GameEngine(std::string name, int width, int height, int colorDepth)
{
	this->name = name;
	this->width = width;
	this->height = height;
	this->colorDepth = colorDepth;
	
	this->errors = initialise();
}

int GameEngine::start()
{
	if (!errors){
		
	}
	
	clean();
	
	return errors;
}

int GameEngine::loadMap()
{
	
}


